//
//  ZLPSubDeatailTableViewCellTwo.m
//  TangYi
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 赵连鹏. All rights reserved.
//

#import "ZLPSubDeatailTableViewCellTwo.h"

@implementation ZLPSubDeatailTableViewCellTwo

- (void)dealloc {
    [_iconImageView release];
    [_iconLabel release];
    [_titleLabel release];
    [_picImageView release];
    [_priceLabel release];
    [_platformLabel release];
    [_platformImageView release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.iconLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.iconLabel];
    self.iconLabel.font = [UIFont systemFontOfSize:15];
    [_iconLabel release];
    
    self.iconImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.iconImageView];
    [_iconImageView release];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    
    self.picImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.picImageView];
    [_picImageView release];
    
    self.priceLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.priceLabel];
    self.priceLabel.textAlignment = NSTextAlignmentRight;
    self.priceLabel.textColor = [UIColor redColor];
    [_priceLabel release];
    
    self.platformLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.platformLabel];
    self.platformLabel.textColor = [UIColor grayColor];
    [_platformLabel release];
    
    self.platformImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.platformImageView];
    [_platformImageView release];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.iconImageView.frame = CGRectMake(5, 15, 15, 15);
    self.iconLabel.frame = CGRectMake(30, 15, 100, 10);
    self.picImageView.frame = CGRectMake(5, 40, 60, 60);
    self.titleLabel.frame = CGRectMake(70, 35, self.contentView.frame.size.width - 100, 30);
    self.platformImageView.frame = CGRectMake(70, 80, 20, 20);
    self.platformLabel.frame = CGRectMake(100, 80, 100, 20);
    self.priceLabel.frame = CGRectMake(self.contentView.frame.size.width - 210, 80, 200, 30);
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
